//
// Created by Administrator on 2022/10/11.
//
#include <stdio.h>
#include <atomicvar.h>
#include <stdlib.h>

#define __USE_UNIX98 1
#include <pthread.h>

#define thread_err 0
#define thread_ok  1
int init_rwlock(pthread_rwlock_t *rw_lock);
int init_pthread_rwlock(pthread_rwlock_t *rw_lock, const pthread_rwlockattr_t *attr);
int init_lock(pthread_mutex_t *mutex_lock);
int init_pthread_lock(pthread_mutex_t *mutex_lock, const pthread_mutexattr_t *attr);
int init_pthread_cond(pthread_cond_t *cond);
//获取读锁
int rwlock_rdlock(pthread_rwlock_t *lock);
//获取写锁
int rwlock_wrlock(pthread_rwlock_t *lock);
//
int rwlock_unlock(pthread_rwlock_t *lock);
// 获取线程锁
int mutex_lock(pthread_mutex_t *lock);
// 释放线程锁
int mutex_unlock(pthread_mutex_t *lock);